package dao;


import java.math.BigDecimal;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.Date;
import java.util.Collections;
import java.util.List;

import org.apache.commons.lang.ObjectUtils;
import org.apache.torque.TorqueException;
import org.apache.torque.om.BaseObject;
import org.apache.torque.om.ComboKey;
import org.apache.torque.om.DateKey;
import org.apache.torque.om.NumberKey;
import org.apache.torque.om.ObjectKey;
import org.apache.torque.om.SimpleKey;
import org.apache.torque.om.StringKey;
import org.apache.torque.om.Persistent;
import org.apache.torque.util.Criteria;
import org.apache.torque.util.Transaction;

  
    
    
    
    
    
    
    
    
    
    
    
    
  
/**
 * This class was autogenerated by Torque on:
 *
 * [Fri Jan 09 02:39:32 PST 2009]
 *
 * You should not use this class directly.  It should not even be
 * extended all references should be to StudentPersonalInformation
 */
public abstract class BaseStudentPersonalInformation extends BaseObject
{
    /** The Peer class */
    private static final StudentPersonalInformationPeer peer =
        new StudentPersonalInformationPeer();

        
    /** The value for the studentpersonalinformationid field */
    private int studentpersonalinformationid;
      
    /** The value for the studentid field */
    private int studentid;
      
    /** The value for the sex field */
    private String sex;
      
    /** The value for the birthdate field */
    private Date birthdate;
      
    /** The value for the civilstatus field */
    private String civilstatus;
      
    /** The value for the citizenship field */
    private String citizenship;
      
    /** The value for the residentialaddress field */
    private String residentialaddress;
      
    /** The value for the residentialaddresszipid field */
    private int residentialaddresszipid;
      
    /** The value for the residentialaddressprovinceid field */
    private int residentialaddressprovinceid;
      
    /** The value for the residentialaddressregionid field */
    private int residentialaddressregionid;
      
    /** The value for the residentialaddresscountryid field */
    private int residentialaddresscountryid;
      
    /** The value for the collegeaddress field */
    private String collegeaddress;
      
    /** The value for the collegeaddresszipid field */
    private int collegeaddresszipid;
      
    /** The value for the collegeaddressprovinceid field */
    private int collegeaddressprovinceid;
      
    /** The value for the collegeaddressregionid field */
    private int collegeaddressregionid;
      
    /** The value for the collegeaddresscountryid field */
    private int collegeaddresscountryid;
      
    /** The value for the telephonenumber field */
    private String telephonenumber;
      
    /** The value for the cellularphonenumber field */
    private String cellularphonenumber;
      
    /** The value for the email field */
    private String email;
      
    /** The value for the highschool field */
    private String highschool;
      
    /** The value for the highschoolgrade field */
    private double highschoolgrade;
      
    /** The value for the fatherfirstname field */
    private String fatherfirstname;
      
    /** The value for the fathermiddlename field */
    private String fathermiddlename;
      
    /** The value for the fatherlastname field */
    private String fatherlastname;
      
    /** The value for the motherfirstname field */
    private String motherfirstname;
      
    /** The value for the mothermiddlename field */
    private String mothermiddlename;
      
    /** The value for the motherlastname field */
    private String motherlastname;
      
    /** The value for the guardianfirstname field */
    private String guardianfirstname;
      
    /** The value for the guardianmiddlename field */
    private String guardianmiddlename;
      
    /** The value for the guardianlastname field */
    private String guardianlastname;
      
    /** The value for the guardianaddress field */
    private String guardianaddress;
      
    /** The value for the guardianaddresszipid field */
    private int guardianaddresszipid;
      
    /** The value for the guardianaddressprovinceid field */
    private int guardianaddressprovinceid;
      
    /** The value for the guardianaddressregionid field */
    private int guardianaddressregionid;
      
    /** The value for the guardianaddresscountryid field */
    private int guardianaddresscountryid;
      
    /** The value for the guardiancontactnumber field */
    private String guardiancontactnumber;
      
    /** The value for the guardianrelation field */
    private String guardianrelation;
      
    /** The value for the guardianemail field */
    private String guardianemail;
  
    
    /**
     * Get the Studentpersonalinformationid
     *
     * @return int
     */
    public int getStudentpersonalinformationid()
    {
        return studentpersonalinformationid;
    }

                        
    /**
     * Set the value of Studentpersonalinformationid
     *
     * @param v new value
     */
    public void setStudentpersonalinformationid(int v) 
    {
    
                  if (this.studentpersonalinformationid != v)
              {
            this.studentpersonalinformationid = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Studentid
     *
     * @return int
     */
    public int getStudentid()
    {
        return studentid;
    }

                              
    /**
     * Set the value of Studentid
     *
     * @param v new value
     */
    public void setStudentid(int v) throws TorqueException
    {
    
                  if (this.studentid != v)
              {
            this.studentid = v;
            setModified(true);
        }
    
                          
                if (aStudent != null && !(aStudent.getStudentid() == v))
                {
            aStudent = null;
        }
      
              }
  
    /**
     * Get the Sex
     *
     * @return String
     */
    public String getSex()
    {
        return sex;
    }

                        
    /**
     * Set the value of Sex
     *
     * @param v new value
     */
    public void setSex(String v) 
    {
    
                  if (!ObjectUtils.equals(this.sex, v))
              {
            this.sex = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Birthdate
     *
     * @return Date
     */
    public Date getBirthdate()
    {
        return birthdate;
    }

                        
    /**
     * Set the value of Birthdate
     *
     * @param v new value
     */
    public void setBirthdate(Date v) 
    {
    
                  if (!ObjectUtils.equals(this.birthdate, v))
              {
            this.birthdate = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Civilstatus
     *
     * @return String
     */
    public String getCivilstatus()
    {
        return civilstatus;
    }

                        
    /**
     * Set the value of Civilstatus
     *
     * @param v new value
     */
    public void setCivilstatus(String v) 
    {
    
                  if (!ObjectUtils.equals(this.civilstatus, v))
              {
            this.civilstatus = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Citizenship
     *
     * @return String
     */
    public String getCitizenship()
    {
        return citizenship;
    }

                        
    /**
     * Set the value of Citizenship
     *
     * @param v new value
     */
    public void setCitizenship(String v) 
    {
    
                  if (!ObjectUtils.equals(this.citizenship, v))
              {
            this.citizenship = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Residentialaddress
     *
     * @return String
     */
    public String getResidentialaddress()
    {
        return residentialaddress;
    }

                        
    /**
     * Set the value of Residentialaddress
     *
     * @param v new value
     */
    public void setResidentialaddress(String v) 
    {
    
                  if (!ObjectUtils.equals(this.residentialaddress, v))
              {
            this.residentialaddress = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Residentialaddresszipid
     *
     * @return int
     */
    public int getResidentialaddresszipid()
    {
        return residentialaddresszipid;
    }

                              
    /**
     * Set the value of Residentialaddresszipid
     *
     * @param v new value
     */
    public void setResidentialaddresszipid(int v) throws TorqueException
    {
    
                  if (this.residentialaddresszipid != v)
              {
            this.residentialaddresszipid = v;
            setModified(true);
        }
    
                                                                  
                if (aZipRelatedByResidentialaddresszipid != null && !(aZipRelatedByResidentialaddresszipid.getZipid() == v))
                {
            aZipRelatedByResidentialaddresszipid = null;
        }
      
              }
  
    /**
     * Get the Residentialaddressprovinceid
     *
     * @return int
     */
    public int getResidentialaddressprovinceid()
    {
        return residentialaddressprovinceid;
    }

                              
    /**
     * Set the value of Residentialaddressprovinceid
     *
     * @param v new value
     */
    public void setResidentialaddressprovinceid(int v) throws TorqueException
    {
    
                  if (this.residentialaddressprovinceid != v)
              {
            this.residentialaddressprovinceid = v;
            setModified(true);
        }
    
                                                                  
                if (aProvinceRelatedByResidentialaddressprovinceid != null && !(aProvinceRelatedByResidentialaddressprovinceid.getProvinceid() == v))
                {
            aProvinceRelatedByResidentialaddressprovinceid = null;
        }
      
              }
  
    /**
     * Get the Residentialaddressregionid
     *
     * @return int
     */
    public int getResidentialaddressregionid()
    {
        return residentialaddressregionid;
    }

                              
    /**
     * Set the value of Residentialaddressregionid
     *
     * @param v new value
     */
    public void setResidentialaddressregionid(int v) throws TorqueException
    {
    
                  if (this.residentialaddressregionid != v)
              {
            this.residentialaddressregionid = v;
            setModified(true);
        }
    
                                                                  
                if (aRegionRelatedByResidentialaddressregionid != null && !(aRegionRelatedByResidentialaddressregionid.getRegionid() == v))
                {
            aRegionRelatedByResidentialaddressregionid = null;
        }
      
              }
  
    /**
     * Get the Residentialaddresscountryid
     *
     * @return int
     */
    public int getResidentialaddresscountryid()
    {
        return residentialaddresscountryid;
    }

                              
    /**
     * Set the value of Residentialaddresscountryid
     *
     * @param v new value
     */
    public void setResidentialaddresscountryid(int v) throws TorqueException
    {
    
                  if (this.residentialaddresscountryid != v)
              {
            this.residentialaddresscountryid = v;
            setModified(true);
        }
    
                                                                  
                if (aCountryRelatedByResidentialaddresscountryid != null && !(aCountryRelatedByResidentialaddresscountryid.getCountryid() == v))
                {
            aCountryRelatedByResidentialaddresscountryid = null;
        }
      
              }
  
    /**
     * Get the Collegeaddress
     *
     * @return String
     */
    public String getCollegeaddress()
    {
        return collegeaddress;
    }

                        
    /**
     * Set the value of Collegeaddress
     *
     * @param v new value
     */
    public void setCollegeaddress(String v) 
    {
    
                  if (!ObjectUtils.equals(this.collegeaddress, v))
              {
            this.collegeaddress = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Collegeaddresszipid
     *
     * @return int
     */
    public int getCollegeaddresszipid()
    {
        return collegeaddresszipid;
    }

                              
    /**
     * Set the value of Collegeaddresszipid
     *
     * @param v new value
     */
    public void setCollegeaddresszipid(int v) throws TorqueException
    {
    
                  if (this.collegeaddresszipid != v)
              {
            this.collegeaddresszipid = v;
            setModified(true);
        }
    
                                                                  
                if (aZipRelatedByCollegeaddresszipid != null && !(aZipRelatedByCollegeaddresszipid.getZipid() == v))
                {
            aZipRelatedByCollegeaddresszipid = null;
        }
      
              }
  
    /**
     * Get the Collegeaddressprovinceid
     *
     * @return int
     */
    public int getCollegeaddressprovinceid()
    {
        return collegeaddressprovinceid;
    }

                              
    /**
     * Set the value of Collegeaddressprovinceid
     *
     * @param v new value
     */
    public void setCollegeaddressprovinceid(int v) throws TorqueException
    {
    
                  if (this.collegeaddressprovinceid != v)
              {
            this.collegeaddressprovinceid = v;
            setModified(true);
        }
    
                                                                  
                if (aProvinceRelatedByCollegeaddressprovinceid != null && !(aProvinceRelatedByCollegeaddressprovinceid.getProvinceid() == v))
                {
            aProvinceRelatedByCollegeaddressprovinceid = null;
        }
      
              }
  
    /**
     * Get the Collegeaddressregionid
     *
     * @return int
     */
    public int getCollegeaddressregionid()
    {
        return collegeaddressregionid;
    }

                              
    /**
     * Set the value of Collegeaddressregionid
     *
     * @param v new value
     */
    public void setCollegeaddressregionid(int v) throws TorqueException
    {
    
                  if (this.collegeaddressregionid != v)
              {
            this.collegeaddressregionid = v;
            setModified(true);
        }
    
                                                                  
                if (aRegionRelatedByCollegeaddressregionid != null && !(aRegionRelatedByCollegeaddressregionid.getRegionid() == v))
                {
            aRegionRelatedByCollegeaddressregionid = null;
        }
      
              }
  
    /**
     * Get the Collegeaddresscountryid
     *
     * @return int
     */
    public int getCollegeaddresscountryid()
    {
        return collegeaddresscountryid;
    }

                              
    /**
     * Set the value of Collegeaddresscountryid
     *
     * @param v new value
     */
    public void setCollegeaddresscountryid(int v) throws TorqueException
    {
    
                  if (this.collegeaddresscountryid != v)
              {
            this.collegeaddresscountryid = v;
            setModified(true);
        }
    
                                                                  
                if (aCountryRelatedByCollegeaddresscountryid != null && !(aCountryRelatedByCollegeaddresscountryid.getCountryid() == v))
                {
            aCountryRelatedByCollegeaddresscountryid = null;
        }
      
              }
  
    /**
     * Get the Telephonenumber
     *
     * @return String
     */
    public String getTelephonenumber()
    {
        return telephonenumber;
    }

                        
    /**
     * Set the value of Telephonenumber
     *
     * @param v new value
     */
    public void setTelephonenumber(String v) 
    {
    
                  if (!ObjectUtils.equals(this.telephonenumber, v))
              {
            this.telephonenumber = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Cellularphonenumber
     *
     * @return String
     */
    public String getCellularphonenumber()
    {
        return cellularphonenumber;
    }

                        
    /**
     * Set the value of Cellularphonenumber
     *
     * @param v new value
     */
    public void setCellularphonenumber(String v) 
    {
    
                  if (!ObjectUtils.equals(this.cellularphonenumber, v))
              {
            this.cellularphonenumber = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Email
     *
     * @return String
     */
    public String getEmail()
    {
        return email;
    }

                        
    /**
     * Set the value of Email
     *
     * @param v new value
     */
    public void setEmail(String v) 
    {
    
                  if (!ObjectUtils.equals(this.email, v))
              {
            this.email = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Highschool
     *
     * @return String
     */
    public String getHighschool()
    {
        return highschool;
    }

                        
    /**
     * Set the value of Highschool
     *
     * @param v new value
     */
    public void setHighschool(String v) 
    {
    
                  if (!ObjectUtils.equals(this.highschool, v))
              {
            this.highschool = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Highschoolgrade
     *
     * @return double
     */
    public double getHighschoolgrade()
    {
        return highschoolgrade;
    }

                        
    /**
     * Set the value of Highschoolgrade
     *
     * @param v new value
     */
    public void setHighschoolgrade(double v) 
    {
    
                  if (this.highschoolgrade != v)
              {
            this.highschoolgrade = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Fatherfirstname
     *
     * @return String
     */
    public String getFatherfirstname()
    {
        return fatherfirstname;
    }

                        
    /**
     * Set the value of Fatherfirstname
     *
     * @param v new value
     */
    public void setFatherfirstname(String v) 
    {
    
                  if (!ObjectUtils.equals(this.fatherfirstname, v))
              {
            this.fatherfirstname = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Fathermiddlename
     *
     * @return String
     */
    public String getFathermiddlename()
    {
        return fathermiddlename;
    }

                        
    /**
     * Set the value of Fathermiddlename
     *
     * @param v new value
     */
    public void setFathermiddlename(String v) 
    {
    
                  if (!ObjectUtils.equals(this.fathermiddlename, v))
              {
            this.fathermiddlename = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Fatherlastname
     *
     * @return String
     */
    public String getFatherlastname()
    {
        return fatherlastname;
    }

                        
    /**
     * Set the value of Fatherlastname
     *
     * @param v new value
     */
    public void setFatherlastname(String v) 
    {
    
                  if (!ObjectUtils.equals(this.fatherlastname, v))
              {
            this.fatherlastname = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Motherfirstname
     *
     * @return String
     */
    public String getMotherfirstname()
    {
        return motherfirstname;
    }

                        
    /**
     * Set the value of Motherfirstname
     *
     * @param v new value
     */
    public void setMotherfirstname(String v) 
    {
    
                  if (!ObjectUtils.equals(this.motherfirstname, v))
              {
            this.motherfirstname = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Mothermiddlename
     *
     * @return String
     */
    public String getMothermiddlename()
    {
        return mothermiddlename;
    }

                        
    /**
     * Set the value of Mothermiddlename
     *
     * @param v new value
     */
    public void setMothermiddlename(String v) 
    {
    
                  if (!ObjectUtils.equals(this.mothermiddlename, v))
              {
            this.mothermiddlename = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Motherlastname
     *
     * @return String
     */
    public String getMotherlastname()
    {
        return motherlastname;
    }

                        
    /**
     * Set the value of Motherlastname
     *
     * @param v new value
     */
    public void setMotherlastname(String v) 
    {
    
                  if (!ObjectUtils.equals(this.motherlastname, v))
              {
            this.motherlastname = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Guardianfirstname
     *
     * @return String
     */
    public String getGuardianfirstname()
    {
        return guardianfirstname;
    }

                        
    /**
     * Set the value of Guardianfirstname
     *
     * @param v new value
     */
    public void setGuardianfirstname(String v) 
    {
    
                  if (!ObjectUtils.equals(this.guardianfirstname, v))
              {
            this.guardianfirstname = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Guardianmiddlename
     *
     * @return String
     */
    public String getGuardianmiddlename()
    {
        return guardianmiddlename;
    }

                        
    /**
     * Set the value of Guardianmiddlename
     *
     * @param v new value
     */
    public void setGuardianmiddlename(String v) 
    {
    
                  if (!ObjectUtils.equals(this.guardianmiddlename, v))
              {
            this.guardianmiddlename = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Guardianlastname
     *
     * @return String
     */
    public String getGuardianlastname()
    {
        return guardianlastname;
    }

                        
    /**
     * Set the value of Guardianlastname
     *
     * @param v new value
     */
    public void setGuardianlastname(String v) 
    {
    
                  if (!ObjectUtils.equals(this.guardianlastname, v))
              {
            this.guardianlastname = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Guardianaddress
     *
     * @return String
     */
    public String getGuardianaddress()
    {
        return guardianaddress;
    }

                        
    /**
     * Set the value of Guardianaddress
     *
     * @param v new value
     */
    public void setGuardianaddress(String v) 
    {
    
                  if (!ObjectUtils.equals(this.guardianaddress, v))
              {
            this.guardianaddress = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Guardianaddresszipid
     *
     * @return int
     */
    public int getGuardianaddresszipid()
    {
        return guardianaddresszipid;
    }

                              
    /**
     * Set the value of Guardianaddresszipid
     *
     * @param v new value
     */
    public void setGuardianaddresszipid(int v) throws TorqueException
    {
    
                  if (this.guardianaddresszipid != v)
              {
            this.guardianaddresszipid = v;
            setModified(true);
        }
    
                                                                  
                if (aZipRelatedByGuardianaddresszipid != null && !(aZipRelatedByGuardianaddresszipid.getZipid() == v))
                {
            aZipRelatedByGuardianaddresszipid = null;
        }
      
              }
  
    /**
     * Get the Guardianaddressprovinceid
     *
     * @return int
     */
    public int getGuardianaddressprovinceid()
    {
        return guardianaddressprovinceid;
    }

                              
    /**
     * Set the value of Guardianaddressprovinceid
     *
     * @param v new value
     */
    public void setGuardianaddressprovinceid(int v) throws TorqueException
    {
    
                  if (this.guardianaddressprovinceid != v)
              {
            this.guardianaddressprovinceid = v;
            setModified(true);
        }
    
                                                                  
                if (aProvinceRelatedByGuardianaddressprovinceid != null && !(aProvinceRelatedByGuardianaddressprovinceid.getProvinceid() == v))
                {
            aProvinceRelatedByGuardianaddressprovinceid = null;
        }
      
              }
  
    /**
     * Get the Guardianaddressregionid
     *
     * @return int
     */
    public int getGuardianaddressregionid()
    {
        return guardianaddressregionid;
    }

                              
    /**
     * Set the value of Guardianaddressregionid
     *
     * @param v new value
     */
    public void setGuardianaddressregionid(int v) throws TorqueException
    {
    
                  if (this.guardianaddressregionid != v)
              {
            this.guardianaddressregionid = v;
            setModified(true);
        }
    
                                                                  
                if (aRegionRelatedByGuardianaddressregionid != null && !(aRegionRelatedByGuardianaddressregionid.getRegionid() == v))
                {
            aRegionRelatedByGuardianaddressregionid = null;
        }
      
              }
  
    /**
     * Get the Guardianaddresscountryid
     *
     * @return int
     */
    public int getGuardianaddresscountryid()
    {
        return guardianaddresscountryid;
    }

                              
    /**
     * Set the value of Guardianaddresscountryid
     *
     * @param v new value
     */
    public void setGuardianaddresscountryid(int v) throws TorqueException
    {
    
                  if (this.guardianaddresscountryid != v)
              {
            this.guardianaddresscountryid = v;
            setModified(true);
        }
    
                                                                  
                if (aCountryRelatedByGuardianaddresscountryid != null && !(aCountryRelatedByGuardianaddresscountryid.getCountryid() == v))
                {
            aCountryRelatedByGuardianaddresscountryid = null;
        }
      
              }
  
    /**
     * Get the Guardiancontactnumber
     *
     * @return String
     */
    public String getGuardiancontactnumber()
    {
        return guardiancontactnumber;
    }

                        
    /**
     * Set the value of Guardiancontactnumber
     *
     * @param v new value
     */
    public void setGuardiancontactnumber(String v) 
    {
    
                  if (!ObjectUtils.equals(this.guardiancontactnumber, v))
              {
            this.guardiancontactnumber = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Guardianrelation
     *
     * @return String
     */
    public String getGuardianrelation()
    {
        return guardianrelation;
    }

                        
    /**
     * Set the value of Guardianrelation
     *
     * @param v new value
     */
    public void setGuardianrelation(String v) 
    {
    
                  if (!ObjectUtils.equals(this.guardianrelation, v))
              {
            this.guardianrelation = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Guardianemail
     *
     * @return String
     */
    public String getGuardianemail()
    {
        return guardianemail;
    }

                        
    /**
     * Set the value of Guardianemail
     *
     * @param v new value
     */
    public void setGuardianemail(String v) 
    {
    
                  if (!ObjectUtils.equals(this.guardianemail, v))
              {
            this.guardianemail = v;
            setModified(true);
        }
    
          
              }
  
      
    
                  
    
        private Student aStudent;

    /**
     * Declares an association between this object and a Student object
     *
     * @param v Student
     * @throws TorqueException
     */
    public void setStudent(Student v) throws TorqueException
    {
            if (v == null)
        {
                    setStudentid(0);
                  }
        else
        {
            setStudentid(v.getStudentid());
        }
                aStudent = v;
    }

                                            
    /**
     * Get the associated Student object
     *
     * @return the associated Student object
     * @throws TorqueException
     */
    public Student getStudent() throws TorqueException
    {
        if (aStudent == null && (this.studentid > 0))
        {
                          aStudent = StudentPeer.retrieveByPK(SimpleKey.keyFor(this.studentid));
              
            /* The following can be used instead of the line above to
               guarantee the related object contains a reference
               to this object, but this level of coupling
               may be undesirable in many circumstances.
               As it can lead to a db query with many results that may
               never be used.
               Student obj = StudentPeer.retrieveByPK(this.studentid);
               obj.addStudentPersonalInformations(this);
            */
        }
        return aStudent;
    }

    /**
     * Provides convenient way to set a relationship based on a
     * ObjectKey.  e.g.
     * <code>bar.setFooKey(foo.getPrimaryKey())</code>
     *
           */
    public void setStudentKey(ObjectKey key) throws TorqueException
    {
      
                        setStudentid(((NumberKey) key).intValue());
                  }
    
    
                        
        
        private Zip aZipRelatedByResidentialaddresszipid;

    /**
     * Declares an association between this object and a Zip object
     *
     * @param v Zip
     * @throws TorqueException
     */
    public void setZipRelatedByResidentialaddresszipid(Zip v) throws TorqueException
    {
            if (v == null)
        {
                    setResidentialaddresszipid(0);
                  }
        else
        {
            setResidentialaddresszipid(v.getZipid());
        }
                aZipRelatedByResidentialaddresszipid = v;
    }

                                            
    /**
     * Get the associated Zip object
     *
     * @return the associated Zip object
     * @throws TorqueException
     */
    public Zip getZipRelatedByResidentialaddresszipid() throws TorqueException
    {
        if (aZipRelatedByResidentialaddresszipid == null && (this.residentialaddresszipid > 0))
        {
                          aZipRelatedByResidentialaddresszipid = ZipPeer.retrieveByPK(SimpleKey.keyFor(this.residentialaddresszipid));
              
            /* The following can be used instead of the line above to
               guarantee the related object contains a reference
               to this object, but this level of coupling
               may be undesirable in many circumstances.
               As it can lead to a db query with many results that may
               never be used.
               Zip obj = ZipPeer.retrieveByPK(this.residentialaddresszipid);
               obj.addStudentPersonalInformationsRelatedByResidentialaddresszipid(this);
            */
        }
        return aZipRelatedByResidentialaddresszipid;
    }

    /**
     * Provides convenient way to set a relationship based on a
     * ObjectKey.  e.g.
     * <code>bar.setFooKey(foo.getPrimaryKey())</code>
     *
           */
    public void setZipRelatedByResidentialaddresszipidKey(ObjectKey key) throws TorqueException
    {
      
                        setResidentialaddresszipid(((NumberKey) key).intValue());
                  }
    
    
                        
        
        private Province aProvinceRelatedByResidentialaddressprovinceid;

    /**
     * Declares an association between this object and a Province object
     *
     * @param v Province
     * @throws TorqueException
     */
    public void setProvinceRelatedByResidentialaddressprovinceid(Province v) throws TorqueException
    {
            if (v == null)
        {
                    setResidentialaddressprovinceid(0);
                  }
        else
        {
            setResidentialaddressprovinceid(v.getProvinceid());
        }
                aProvinceRelatedByResidentialaddressprovinceid = v;
    }

                                            
    /**
     * Get the associated Province object
     *
     * @return the associated Province object
     * @throws TorqueException
     */
    public Province getProvinceRelatedByResidentialaddressprovinceid() throws TorqueException
    {
        if (aProvinceRelatedByResidentialaddressprovinceid == null && (this.residentialaddressprovinceid > 0))
        {
                          aProvinceRelatedByResidentialaddressprovinceid = ProvincePeer.retrieveByPK(SimpleKey.keyFor(this.residentialaddressprovinceid));
              
            /* The following can be used instead of the line above to
               guarantee the related object contains a reference
               to this object, but this level of coupling
               may be undesirable in many circumstances.
               As it can lead to a db query with many results that may
               never be used.
               Province obj = ProvincePeer.retrieveByPK(this.residentialaddressprovinceid);
               obj.addStudentPersonalInformationsRelatedByResidentialaddressprovinceid(this);
            */
        }
        return aProvinceRelatedByResidentialaddressprovinceid;
    }

    /**
     * Provides convenient way to set a relationship based on a
     * ObjectKey.  e.g.
     * <code>bar.setFooKey(foo.getPrimaryKey())</code>
     *
           */
    public void setProvinceRelatedByResidentialaddressprovinceidKey(ObjectKey key) throws TorqueException
    {
      
                        setResidentialaddressprovinceid(((NumberKey) key).intValue());
                  }
    
    
                        
        
        private Region aRegionRelatedByResidentialaddressregionid;

    /**
     * Declares an association between this object and a Region object
     *
     * @param v Region
     * @throws TorqueException
     */
    public void setRegionRelatedByResidentialaddressregionid(Region v) throws TorqueException
    {
            if (v == null)
        {
                    setResidentialaddressregionid(0);
                  }
        else
        {
            setResidentialaddressregionid(v.getRegionid());
        }
                aRegionRelatedByResidentialaddressregionid = v;
    }

                                            
    /**
     * Get the associated Region object
     *
     * @return the associated Region object
     * @throws TorqueException
     */
    public Region getRegionRelatedByResidentialaddressregionid() throws TorqueException
    {
        if (aRegionRelatedByResidentialaddressregionid == null && (this.residentialaddressregionid > 0))
        {
                          aRegionRelatedByResidentialaddressregionid = RegionPeer.retrieveByPK(SimpleKey.keyFor(this.residentialaddressregionid));
              
            /* The following can be used instead of the line above to
               guarantee the related object contains a reference
               to this object, but this level of coupling
               may be undesirable in many circumstances.
               As it can lead to a db query with many results that may
               never be used.
               Region obj = RegionPeer.retrieveByPK(this.residentialaddressregionid);
               obj.addStudentPersonalInformationsRelatedByResidentialaddressregionid(this);
            */
        }
        return aRegionRelatedByResidentialaddressregionid;
    }

    /**
     * Provides convenient way to set a relationship based on a
     * ObjectKey.  e.g.
     * <code>bar.setFooKey(foo.getPrimaryKey())</code>
     *
           */
    public void setRegionRelatedByResidentialaddressregionidKey(ObjectKey key) throws TorqueException
    {
      
                        setResidentialaddressregionid(((NumberKey) key).intValue());
                  }
    
    
                        
        
        private Country aCountryRelatedByResidentialaddresscountryid;

    /**
     * Declares an association between this object and a Country object
     *
     * @param v Country
     * @throws TorqueException
     */
    public void setCountryRelatedByResidentialaddresscountryid(Country v) throws TorqueException
    {
            if (v == null)
        {
                    setResidentialaddresscountryid(0);
                  }
        else
        {
            setResidentialaddresscountryid(v.getCountryid());
        }
                aCountryRelatedByResidentialaddresscountryid = v;
    }

                                            
    /**
     * Get the associated Country object
     *
     * @return the associated Country object
     * @throws TorqueException
     */
    public Country getCountryRelatedByResidentialaddresscountryid() throws TorqueException
    {
        if (aCountryRelatedByResidentialaddresscountryid == null && (this.residentialaddresscountryid > 0))
        {
                          aCountryRelatedByResidentialaddresscountryid = CountryPeer.retrieveByPK(SimpleKey.keyFor(this.residentialaddresscountryid));
              
            /* The following can be used instead of the line above to
               guarantee the related object contains a reference
               to this object, but this level of coupling
               may be undesirable in many circumstances.
               As it can lead to a db query with many results that may
               never be used.
               Country obj = CountryPeer.retrieveByPK(this.residentialaddresscountryid);
               obj.addStudentPersonalInformationsRelatedByResidentialaddresscountryid(this);
            */
        }
        return aCountryRelatedByResidentialaddresscountryid;
    }

    /**
     * Provides convenient way to set a relationship based on a
     * ObjectKey.  e.g.
     * <code>bar.setFooKey(foo.getPrimaryKey())</code>
     *
           */
    public void setCountryRelatedByResidentialaddresscountryidKey(ObjectKey key) throws TorqueException
    {
      
                        setResidentialaddresscountryid(((NumberKey) key).intValue());
                  }
    
    
                        
        
        private Zip aZipRelatedByCollegeaddresszipid;

    /**
     * Declares an association between this object and a Zip object
     *
     * @param v Zip
     * @throws TorqueException
     */
    public void setZipRelatedByCollegeaddresszipid(Zip v) throws TorqueException
    {
            if (v == null)
        {
                    setCollegeaddresszipid(0);
                  }
        else
        {
            setCollegeaddresszipid(v.getZipid());
        }
                aZipRelatedByCollegeaddresszipid = v;
    }

                                            
    /**
     * Get the associated Zip object
     *
     * @return the associated Zip object
     * @throws TorqueException
     */
    public Zip getZipRelatedByCollegeaddresszipid() throws TorqueException
    {
        if (aZipRelatedByCollegeaddresszipid == null && (this.collegeaddresszipid > 0))
        {
                          aZipRelatedByCollegeaddresszipid = ZipPeer.retrieveByPK(SimpleKey.keyFor(this.collegeaddresszipid));
              
            /* The following can be used instead of the line above to
               guarantee the related object contains a reference
               to this object, but this level of coupling
               may be undesirable in many circumstances.
               As it can lead to a db query with many results that may
               never be used.
               Zip obj = ZipPeer.retrieveByPK(this.collegeaddresszipid);
               obj.addStudentPersonalInformationsRelatedByCollegeaddresszipid(this);
            */
        }
        return aZipRelatedByCollegeaddresszipid;
    }

    /**
     * Provides convenient way to set a relationship based on a
     * ObjectKey.  e.g.
     * <code>bar.setFooKey(foo.getPrimaryKey())</code>
     *
           */
    public void setZipRelatedByCollegeaddresszipidKey(ObjectKey key) throws TorqueException
    {
      
                        setCollegeaddresszipid(((NumberKey) key).intValue());
                  }
    
    
                        
        
        private Province aProvinceRelatedByCollegeaddressprovinceid;

    /**
     * Declares an association between this object and a Province object
     *
     * @param v Province
     * @throws TorqueException
     */
    public void setProvinceRelatedByCollegeaddressprovinceid(Province v) throws TorqueException
    {
            if (v == null)
        {
                    setCollegeaddressprovinceid(0);
                  }
        else
        {
            setCollegeaddressprovinceid(v.getProvinceid());
        }
                aProvinceRelatedByCollegeaddressprovinceid = v;
    }

                                            
    /**
     * Get the associated Province object
     *
     * @return the associated Province object
     * @throws TorqueException
     */
    public Province getProvinceRelatedByCollegeaddressprovinceid() throws TorqueException
    {
        if (aProvinceRelatedByCollegeaddressprovinceid == null && (this.collegeaddressprovinceid > 0))
        {
                          aProvinceRelatedByCollegeaddressprovinceid = ProvincePeer.retrieveByPK(SimpleKey.keyFor(this.collegeaddressprovinceid));
              
            /* The following can be used instead of the line above to
               guarantee the related object contains a reference
               to this object, but this level of coupling
               may be undesirable in many circumstances.
               As it can lead to a db query with many results that may
               never be used.
               Province obj = ProvincePeer.retrieveByPK(this.collegeaddressprovinceid);
               obj.addStudentPersonalInformationsRelatedByCollegeaddressprovinceid(this);
            */
        }
        return aProvinceRelatedByCollegeaddressprovinceid;
    }

    /**
     * Provides convenient way to set a relationship based on a
     * ObjectKey.  e.g.
     * <code>bar.setFooKey(foo.getPrimaryKey())</code>
     *
           */
    public void setProvinceRelatedByCollegeaddressprovinceidKey(ObjectKey key) throws TorqueException
    {
      
                        setCollegeaddressprovinceid(((NumberKey) key).intValue());
                  }
    
    
                        
        
        private Region aRegionRelatedByCollegeaddressregionid;

    /**
     * Declares an association between this object and a Region object
     *
     * @param v Region
     * @throws TorqueException
     */
    public void setRegionRelatedByCollegeaddressregionid(Region v) throws TorqueException
    {
            if (v == null)
        {
                    setCollegeaddressregionid(0);
                  }
        else
        {
            setCollegeaddressregionid(v.getRegionid());
        }
                aRegionRelatedByCollegeaddressregionid = v;
    }

                                            
    /**
     * Get the associated Region object
     *
     * @return the associated Region object
     * @throws TorqueException
     */
    public Region getRegionRelatedByCollegeaddressregionid() throws TorqueException
    {
        if (aRegionRelatedByCollegeaddressregionid == null && (this.collegeaddressregionid > 0))
        {
                          aRegionRelatedByCollegeaddressregionid = RegionPeer.retrieveByPK(SimpleKey.keyFor(this.collegeaddressregionid));
              
            /* The following can be used instead of the line above to
               guarantee the related object contains a reference
               to this object, but this level of coupling
               may be undesirable in many circumstances.
               As it can lead to a db query with many results that may
               never be used.
               Region obj = RegionPeer.retrieveByPK(this.collegeaddressregionid);
               obj.addStudentPersonalInformationsRelatedByCollegeaddressregionid(this);
            */
        }
        return aRegionRelatedByCollegeaddressregionid;
    }

    /**
     * Provides convenient way to set a relationship based on a
     * ObjectKey.  e.g.
     * <code>bar.setFooKey(foo.getPrimaryKey())</code>
     *
           */
    public void setRegionRelatedByCollegeaddressregionidKey(ObjectKey key) throws TorqueException
    {
      
                        setCollegeaddressregionid(((NumberKey) key).intValue());
                  }
    
    
                        
        
        private Country aCountryRelatedByCollegeaddresscountryid;

    /**
     * Declares an association between this object and a Country object
     *
     * @param v Country
     * @throws TorqueException
     */
    public void setCountryRelatedByCollegeaddresscountryid(Country v) throws TorqueException
    {
            if (v == null)
        {
                    setCollegeaddresscountryid(0);
                  }
        else
        {
            setCollegeaddresscountryid(v.getCountryid());
        }
                aCountryRelatedByCollegeaddresscountryid = v;
    }

                                            
    /**
     * Get the associated Country object
     *
     * @return the associated Country object
     * @throws TorqueException
     */
    public Country getCountryRelatedByCollegeaddresscountryid() throws TorqueException
    {
        if (aCountryRelatedByCollegeaddresscountryid == null && (this.collegeaddresscountryid > 0))
        {
                          aCountryRelatedByCollegeaddresscountryid = CountryPeer.retrieveByPK(SimpleKey.keyFor(this.collegeaddresscountryid));
              
            /* The following can be used instead of the line above to
               guarantee the related object contains a reference
               to this object, but this level of coupling
               may be undesirable in many circumstances.
               As it can lead to a db query with many results that may
               never be used.
               Country obj = CountryPeer.retrieveByPK(this.collegeaddresscountryid);
               obj.addStudentPersonalInformationsRelatedByCollegeaddresscountryid(this);
            */
        }
        return aCountryRelatedByCollegeaddresscountryid;
    }

    /**
     * Provides convenient way to set a relationship based on a
     * ObjectKey.  e.g.
     * <code>bar.setFooKey(foo.getPrimaryKey())</code>
     *
           */
    public void setCountryRelatedByCollegeaddresscountryidKey(ObjectKey key) throws TorqueException
    {
      
                        setCollegeaddresscountryid(((NumberKey) key).intValue());
                  }
    
    
                        
        
        private Zip aZipRelatedByGuardianaddresszipid;

    /**
     * Declares an association between this object and a Zip object
     *
     * @param v Zip
     * @throws TorqueException
     */
    public void setZipRelatedByGuardianaddresszipid(Zip v) throws TorqueException
    {
            if (v == null)
        {
                    setGuardianaddresszipid(0);
                  }
        else
        {
            setGuardianaddresszipid(v.getZipid());
        }
                aZipRelatedByGuardianaddresszipid = v;
    }

                                            
    /**
     * Get the associated Zip object
     *
     * @return the associated Zip object
     * @throws TorqueException
     */
    public Zip getZipRelatedByGuardianaddresszipid() throws TorqueException
    {
        if (aZipRelatedByGuardianaddresszipid == null && (this.guardianaddresszipid > 0))
        {
                          aZipRelatedByGuardianaddresszipid = ZipPeer.retrieveByPK(SimpleKey.keyFor(this.guardianaddresszipid));
              
            /* The following can be used instead of the line above to
               guarantee the related object contains a reference
               to this object, but this level of coupling
               may be undesirable in many circumstances.
               As it can lead to a db query with many results that may
               never be used.
               Zip obj = ZipPeer.retrieveByPK(this.guardianaddresszipid);
               obj.addStudentPersonalInformationsRelatedByGuardianaddresszipid(this);
            */
        }
        return aZipRelatedByGuardianaddresszipid;
    }

    /**
     * Provides convenient way to set a relationship based on a
     * ObjectKey.  e.g.
     * <code>bar.setFooKey(foo.getPrimaryKey())</code>
     *
           */
    public void setZipRelatedByGuardianaddresszipidKey(ObjectKey key) throws TorqueException
    {
      
                        setGuardianaddresszipid(((NumberKey) key).intValue());
                  }
    
    
                        
        
        private Province aProvinceRelatedByGuardianaddressprovinceid;

    /**
     * Declares an association between this object and a Province object
     *
     * @param v Province
     * @throws TorqueException
     */
    public void setProvinceRelatedByGuardianaddressprovinceid(Province v) throws TorqueException
    {
            if (v == null)
        {
                    setGuardianaddressprovinceid(0);
                  }
        else
        {
            setGuardianaddressprovinceid(v.getProvinceid());
        }
                aProvinceRelatedByGuardianaddressprovinceid = v;
    }

                                            
    /**
     * Get the associated Province object
     *
     * @return the associated Province object
     * @throws TorqueException
     */
    public Province getProvinceRelatedByGuardianaddressprovinceid() throws TorqueException
    {
        if (aProvinceRelatedByGuardianaddressprovinceid == null && (this.guardianaddressprovinceid > 0))
        {
                          aProvinceRelatedByGuardianaddressprovinceid = ProvincePeer.retrieveByPK(SimpleKey.keyFor(this.guardianaddressprovinceid));
              
            /* The following can be used instead of the line above to
               guarantee the related object contains a reference
               to this object, but this level of coupling
               may be undesirable in many circumstances.
               As it can lead to a db query with many results that may
               never be used.
               Province obj = ProvincePeer.retrieveByPK(this.guardianaddressprovinceid);
               obj.addStudentPersonalInformationsRelatedByGuardianaddressprovinceid(this);
            */
        }
        return aProvinceRelatedByGuardianaddressprovinceid;
    }

    /**
     * Provides convenient way to set a relationship based on a
     * ObjectKey.  e.g.
     * <code>bar.setFooKey(foo.getPrimaryKey())</code>
     *
           */
    public void setProvinceRelatedByGuardianaddressprovinceidKey(ObjectKey key) throws TorqueException
    {
      
                        setGuardianaddressprovinceid(((NumberKey) key).intValue());
                  }
    
    
                        
        
        private Region aRegionRelatedByGuardianaddressregionid;

    /**
     * Declares an association between this object and a Region object
     *
     * @param v Region
     * @throws TorqueException
     */
    public void setRegionRelatedByGuardianaddressregionid(Region v) throws TorqueException
    {
            if (v == null)
        {
                    setGuardianaddressregionid(0);
                  }
        else
        {
            setGuardianaddressregionid(v.getRegionid());
        }
                aRegionRelatedByGuardianaddressregionid = v;
    }

                                            
    /**
     * Get the associated Region object
     *
     * @return the associated Region object
     * @throws TorqueException
     */
    public Region getRegionRelatedByGuardianaddressregionid() throws TorqueException
    {
        if (aRegionRelatedByGuardianaddressregionid == null && (this.guardianaddressregionid > 0))
        {
                          aRegionRelatedByGuardianaddressregionid = RegionPeer.retrieveByPK(SimpleKey.keyFor(this.guardianaddressregionid));
              
            /* The following can be used instead of the line above to
               guarantee the related object contains a reference
               to this object, but this level of coupling
               may be undesirable in many circumstances.
               As it can lead to a db query with many results that may
               never be used.
               Region obj = RegionPeer.retrieveByPK(this.guardianaddressregionid);
               obj.addStudentPersonalInformationsRelatedByGuardianaddressregionid(this);
            */
        }
        return aRegionRelatedByGuardianaddressregionid;
    }

    /**
     * Provides convenient way to set a relationship based on a
     * ObjectKey.  e.g.
     * <code>bar.setFooKey(foo.getPrimaryKey())</code>
     *
           */
    public void setRegionRelatedByGuardianaddressregionidKey(ObjectKey key) throws TorqueException
    {
      
                        setGuardianaddressregionid(((NumberKey) key).intValue());
                  }
    
    
                        
        
        private Country aCountryRelatedByGuardianaddresscountryid;

    /**
     * Declares an association between this object and a Country object
     *
     * @param v Country
     * @throws TorqueException
     */
    public void setCountryRelatedByGuardianaddresscountryid(Country v) throws TorqueException
    {
            if (v == null)
        {
                    setGuardianaddresscountryid(0);
                  }
        else
        {
            setGuardianaddresscountryid(v.getCountryid());
        }
                aCountryRelatedByGuardianaddresscountryid = v;
    }

                                            
    /**
     * Get the associated Country object
     *
     * @return the associated Country object
     * @throws TorqueException
     */
    public Country getCountryRelatedByGuardianaddresscountryid() throws TorqueException
    {
        if (aCountryRelatedByGuardianaddresscountryid == null && (this.guardianaddresscountryid > 0))
        {
                          aCountryRelatedByGuardianaddresscountryid = CountryPeer.retrieveByPK(SimpleKey.keyFor(this.guardianaddresscountryid));
              
            /* The following can be used instead of the line above to
               guarantee the related object contains a reference
               to this object, but this level of coupling
               may be undesirable in many circumstances.
               As it can lead to a db query with many results that may
               never be used.
               Country obj = CountryPeer.retrieveByPK(this.guardianaddresscountryid);
               obj.addStudentPersonalInformationsRelatedByGuardianaddresscountryid(this);
            */
        }
        return aCountryRelatedByGuardianaddresscountryid;
    }

    /**
     * Provides convenient way to set a relationship based on a
     * ObjectKey.  e.g.
     * <code>bar.setFooKey(foo.getPrimaryKey())</code>
     *
           */
    public void setCountryRelatedByGuardianaddresscountryidKey(ObjectKey key) throws TorqueException
    {
      
                        setGuardianaddresscountryid(((NumberKey) key).intValue());
                  }
       
                
    private static List fieldNames = null;

    /**
     * Generate a list of field names.
     *
     * @return a list of field names
     */
    public static synchronized List getFieldNames()
    {
        if (fieldNames == null)
        {
            fieldNames = new ArrayList();
              fieldNames.add("Studentpersonalinformationid");
              fieldNames.add("Studentid");
              fieldNames.add("Sex");
              fieldNames.add("Birthdate");
              fieldNames.add("Civilstatus");
              fieldNames.add("Citizenship");
              fieldNames.add("Residentialaddress");
              fieldNames.add("Residentialaddresszipid");
              fieldNames.add("Residentialaddressprovinceid");
              fieldNames.add("Residentialaddressregionid");
              fieldNames.add("Residentialaddresscountryid");
              fieldNames.add("Collegeaddress");
              fieldNames.add("Collegeaddresszipid");
              fieldNames.add("Collegeaddressprovinceid");
              fieldNames.add("Collegeaddressregionid");
              fieldNames.add("Collegeaddresscountryid");
              fieldNames.add("Telephonenumber");
              fieldNames.add("Cellularphonenumber");
              fieldNames.add("Email");
              fieldNames.add("Highschool");
              fieldNames.add("Highschoolgrade");
              fieldNames.add("Fatherfirstname");
              fieldNames.add("Fathermiddlename");
              fieldNames.add("Fatherlastname");
              fieldNames.add("Motherfirstname");
              fieldNames.add("Mothermiddlename");
              fieldNames.add("Motherlastname");
              fieldNames.add("Guardianfirstname");
              fieldNames.add("Guardianmiddlename");
              fieldNames.add("Guardianlastname");
              fieldNames.add("Guardianaddress");
              fieldNames.add("Guardianaddresszipid");
              fieldNames.add("Guardianaddressprovinceid");
              fieldNames.add("Guardianaddressregionid");
              fieldNames.add("Guardianaddresscountryid");
              fieldNames.add("Guardiancontactnumber");
              fieldNames.add("Guardianrelation");
              fieldNames.add("Guardianemail");
              fieldNames = Collections.unmodifiableList(fieldNames);
        }
        return fieldNames;
    }

    /**
     * Retrieves a field from the object by name passed in as a String.
     *
     * @param name field name
     * @return value
     */
    public Object getByName(String name)
    {
          if (name.equals("Studentpersonalinformationid"))
        {
                return new Integer(getStudentpersonalinformationid());
            }
          if (name.equals("Studentid"))
        {
                return new Integer(getStudentid());
            }
          if (name.equals("Sex"))
        {
                return getSex();
            }
          if (name.equals("Birthdate"))
        {
                return getBirthdate();
            }
          if (name.equals("Civilstatus"))
        {
                return getCivilstatus();
            }
          if (name.equals("Citizenship"))
        {
                return getCitizenship();
            }
          if (name.equals("Residentialaddress"))
        {
                return getResidentialaddress();
            }
          if (name.equals("Residentialaddresszipid"))
        {
                return new Integer(getResidentialaddresszipid());
            }
          if (name.equals("Residentialaddressprovinceid"))
        {
                return new Integer(getResidentialaddressprovinceid());
            }
          if (name.equals("Residentialaddressregionid"))
        {
                return new Integer(getResidentialaddressregionid());
            }
          if (name.equals("Residentialaddresscountryid"))
        {
                return new Integer(getResidentialaddresscountryid());
            }
          if (name.equals("Collegeaddress"))
        {
                return getCollegeaddress();
            }
          if (name.equals("Collegeaddresszipid"))
        {
                return new Integer(getCollegeaddresszipid());
            }
          if (name.equals("Collegeaddressprovinceid"))
        {
                return new Integer(getCollegeaddressprovinceid());
            }
          if (name.equals("Collegeaddressregionid"))
        {
                return new Integer(getCollegeaddressregionid());
            }
          if (name.equals("Collegeaddresscountryid"))
        {
                return new Integer(getCollegeaddresscountryid());
            }
          if (name.equals("Telephonenumber"))
        {
                return getTelephonenumber();
            }
          if (name.equals("Cellularphonenumber"))
        {
                return getCellularphonenumber();
            }
          if (name.equals("Email"))
        {
                return getEmail();
            }
          if (name.equals("Highschool"))
        {
                return getHighschool();
            }
          if (name.equals("Highschoolgrade"))
        {
                return new Double(getHighschoolgrade());
            }
          if (name.equals("Fatherfirstname"))
        {
                return getFatherfirstname();
            }
          if (name.equals("Fathermiddlename"))
        {
                return getFathermiddlename();
            }
          if (name.equals("Fatherlastname"))
        {
                return getFatherlastname();
            }
          if (name.equals("Motherfirstname"))
        {
                return getMotherfirstname();
            }
          if (name.equals("Mothermiddlename"))
        {
                return getMothermiddlename();
            }
          if (name.equals("Motherlastname"))
        {
                return getMotherlastname();
            }
          if (name.equals("Guardianfirstname"))
        {
                return getGuardianfirstname();
            }
          if (name.equals("Guardianmiddlename"))
        {
                return getGuardianmiddlename();
            }
          if (name.equals("Guardianlastname"))
        {
                return getGuardianlastname();
            }
          if (name.equals("Guardianaddress"))
        {
                return getGuardianaddress();
            }
          if (name.equals("Guardianaddresszipid"))
        {
                return new Integer(getGuardianaddresszipid());
            }
          if (name.equals("Guardianaddressprovinceid"))
        {
                return new Integer(getGuardianaddressprovinceid());
            }
          if (name.equals("Guardianaddressregionid"))
        {
                return new Integer(getGuardianaddressregionid());
            }
          if (name.equals("Guardianaddresscountryid"))
        {
                return new Integer(getGuardianaddresscountryid());
            }
          if (name.equals("Guardiancontactnumber"))
        {
                return getGuardiancontactnumber();
            }
          if (name.equals("Guardianrelation"))
        {
                return getGuardianrelation();
            }
          if (name.equals("Guardianemail"))
        {
                return getGuardianemail();
            }
          return null;
    }
    
    /**
     * Retrieves a field from the object by name passed in
     * as a String.  The String must be one of the static
     * Strings defined in this Class' Peer.
     *
     * @param name peer name
     * @return value
     */
    public Object getByPeerName(String name)
    {
          if (name.equals(StudentPersonalInformationPeer.STUDENTPERSONALINFORMATIONID))
        {
                return new Integer(getStudentpersonalinformationid());
            }
          if (name.equals(StudentPersonalInformationPeer.STUDENTID))
        {
                return new Integer(getStudentid());
            }
          if (name.equals(StudentPersonalInformationPeer.SEX))
        {
                return getSex();
            }
          if (name.equals(StudentPersonalInformationPeer.BIRTHDATE))
        {
                return getBirthdate();
            }
          if (name.equals(StudentPersonalInformationPeer.CIVILSTATUS))
        {
                return getCivilstatus();
            }
          if (name.equals(StudentPersonalInformationPeer.CITIZENSHIP))
        {
                return getCitizenship();
            }
          if (name.equals(StudentPersonalInformationPeer.RESIDENTIALADDRESS))
        {
                return getResidentialaddress();
            }
          if (name.equals(StudentPersonalInformationPeer.RESIDENTIALADDRESSZIPID))
        {
                return new Integer(getResidentialaddresszipid());
            }
          if (name.equals(StudentPersonalInformationPeer.RESIDENTIALADDRESSPROVINCEID))
        {
                return new Integer(getResidentialaddressprovinceid());
            }
          if (name.equals(StudentPersonalInformationPeer.RESIDENTIALADDRESSREGIONID))
        {
                return new Integer(getResidentialaddressregionid());
            }
          if (name.equals(StudentPersonalInformationPeer.RESIDENTIALADDRESSCOUNTRYID))
        {
                return new Integer(getResidentialaddresscountryid());
            }
          if (name.equals(StudentPersonalInformationPeer.COLLEGEADDRESS))
        {
                return getCollegeaddress();
            }
          if (name.equals(StudentPersonalInformationPeer.COLLEGEADDRESSZIPID))
        {
                return new Integer(getCollegeaddresszipid());
            }
          if (name.equals(StudentPersonalInformationPeer.COLLEGEADDRESSPROVINCEID))
        {
                return new Integer(getCollegeaddressprovinceid());
            }
          if (name.equals(StudentPersonalInformationPeer.COLLEGEADDRESSREGIONID))
        {
                return new Integer(getCollegeaddressregionid());
            }
          if (name.equals(StudentPersonalInformationPeer.COLLEGEADDRESSCOUNTRYID))
        {
                return new Integer(getCollegeaddresscountryid());
            }
          if (name.equals(StudentPersonalInformationPeer.TELEPHONENUMBER))
        {
                return getTelephonenumber();
            }
          if (name.equals(StudentPersonalInformationPeer.CELLULARPHONENUMBER))
        {
                return getCellularphonenumber();
            }
          if (name.equals(StudentPersonalInformationPeer.EMAIL))
        {
                return getEmail();
            }
          if (name.equals(StudentPersonalInformationPeer.HIGHSCHOOL))
        {
                return getHighschool();
            }
          if (name.equals(StudentPersonalInformationPeer.HIGHSCHOOLGRADE))
        {
                return new Double(getHighschoolgrade());
            }
          if (name.equals(StudentPersonalInformationPeer.FATHERFIRSTNAME))
        {
                return getFatherfirstname();
            }
          if (name.equals(StudentPersonalInformationPeer.FATHERMIDDLENAME))
        {
                return getFathermiddlename();
            }
          if (name.equals(StudentPersonalInformationPeer.FATHERLASTNAME))
        {
                return getFatherlastname();
            }
          if (name.equals(StudentPersonalInformationPeer.MOTHERFIRSTNAME))
        {
                return getMotherfirstname();
            }
          if (name.equals(StudentPersonalInformationPeer.MOTHERMIDDLENAME))
        {
                return getMothermiddlename();
            }
          if (name.equals(StudentPersonalInformationPeer.MOTHERLASTNAME))
        {
                return getMotherlastname();
            }
          if (name.equals(StudentPersonalInformationPeer.GUARDIANFIRSTNAME))
        {
                return getGuardianfirstname();
            }
          if (name.equals(StudentPersonalInformationPeer.GUARDIANMIDDLENAME))
        {
                return getGuardianmiddlename();
            }
          if (name.equals(StudentPersonalInformationPeer.GUARDIANLASTNAME))
        {
                return getGuardianlastname();
            }
          if (name.equals(StudentPersonalInformationPeer.GUARDIANADDRESS))
        {
                return getGuardianaddress();
            }
          if (name.equals(StudentPersonalInformationPeer.GUARDIANADDRESSZIPID))
        {
                return new Integer(getGuardianaddresszipid());
            }
          if (name.equals(StudentPersonalInformationPeer.GUARDIANADDRESSPROVINCEID))
        {
                return new Integer(getGuardianaddressprovinceid());
            }
          if (name.equals(StudentPersonalInformationPeer.GUARDIANADDRESSREGIONID))
        {
                return new Integer(getGuardianaddressregionid());
            }
          if (name.equals(StudentPersonalInformationPeer.GUARDIANADDRESSCOUNTRYID))
        {
                return new Integer(getGuardianaddresscountryid());
            }
          if (name.equals(StudentPersonalInformationPeer.GUARDIANCONTACTNUMBER))
        {
                return getGuardiancontactnumber();
            }
          if (name.equals(StudentPersonalInformationPeer.GUARDIANRELATION))
        {
                return getGuardianrelation();
            }
          if (name.equals(StudentPersonalInformationPeer.GUARDIANEMAIL))
        {
                return getGuardianemail();
            }
          return null;
    }

    /**
     * Retrieves a field from the object by Position as specified
     * in the xml schema.  Zero-based.
     *
     * @param pos position in xml schema
     * @return value
     */
    public Object getByPosition(int pos)
    {
            if (pos == 0)
        {
                return new Integer(getStudentpersonalinformationid());
            }
              if (pos == 1)
        {
                return new Integer(getStudentid());
            }
              if (pos == 2)
        {
                return getSex();
            }
              if (pos == 3)
        {
                return getBirthdate();
            }
              if (pos == 4)
        {
                return getCivilstatus();
            }
              if (pos == 5)
        {
                return getCitizenship();
            }
              if (pos == 6)
        {
                return getResidentialaddress();
            }
              if (pos == 7)
        {
                return new Integer(getResidentialaddresszipid());
            }
              if (pos == 8)
        {
                return new Integer(getResidentialaddressprovinceid());
            }
              if (pos == 9)
        {
                return new Integer(getResidentialaddressregionid());
            }
              if (pos == 10)
        {
                return new Integer(getResidentialaddresscountryid());
            }
              if (pos == 11)
        {
                return getCollegeaddress();
            }
              if (pos == 12)
        {
                return new Integer(getCollegeaddresszipid());
            }
              if (pos == 13)
        {
                return new Integer(getCollegeaddressprovinceid());
            }
              if (pos == 14)
        {
                return new Integer(getCollegeaddressregionid());
            }
              if (pos == 15)
        {
                return new Integer(getCollegeaddresscountryid());
            }
              if (pos == 16)
        {
                return getTelephonenumber();
            }
              if (pos == 17)
        {
                return getCellularphonenumber();
            }
              if (pos == 18)
        {
                return getEmail();
            }
              if (pos == 19)
        {
                return getHighschool();
            }
              if (pos == 20)
        {
                return new Double(getHighschoolgrade());
            }
              if (pos == 21)
        {
                return getFatherfirstname();
            }
              if (pos == 22)
        {
                return getFathermiddlename();
            }
              if (pos == 23)
        {
                return getFatherlastname();
            }
              if (pos == 24)
        {
                return getMotherfirstname();
            }
              if (pos == 25)
        {
                return getMothermiddlename();
            }
              if (pos == 26)
        {
                return getMotherlastname();
            }
              if (pos == 27)
        {
                return getGuardianfirstname();
            }
              if (pos == 28)
        {
                return getGuardianmiddlename();
            }
              if (pos == 29)
        {
                return getGuardianlastname();
            }
              if (pos == 30)
        {
                return getGuardianaddress();
            }
              if (pos == 31)
        {
                return new Integer(getGuardianaddresszipid());
            }
              if (pos == 32)
        {
                return new Integer(getGuardianaddressprovinceid());
            }
              if (pos == 33)
        {
                return new Integer(getGuardianaddressregionid());
            }
              if (pos == 34)
        {
                return new Integer(getGuardianaddresscountryid());
            }
              if (pos == 35)
        {
                return getGuardiancontactnumber();
            }
              if (pos == 36)
        {
                return getGuardianrelation();
            }
              if (pos == 37)
        {
                return getGuardianemail();
            }
              return null;
    }
     
    /**
     * Stores the object in the database.  If the object is new,
     * it inserts it; otherwise an update is performed.
     *
     * @throws Exception
     */
    public void save() throws Exception
    {
          save(StudentPersonalInformationPeer.getMapBuilder()
                .getDatabaseMap().getName());
      }

    /**
     * Stores the object in the database.  If the object is new,
     * it inserts it; otherwise an update is performed.
       * Note: this code is here because the method body is
     * auto-generated conditionally and therefore needs to be
     * in this file instead of in the super class, BaseObject.
       *
     * @param dbName
     * @throws TorqueException
     */
    public void save(String dbName) throws TorqueException
    {
        Connection con = null;
          try
        {
            con = Transaction.begin(dbName);
            save(con);
            Transaction.commit(con);
        }
        catch(TorqueException e)
        {
            Transaction.safeRollback(con);
            throw e;
        }
      }

      /** flag to prevent endless save loop, if this object is referenced
        by another object which falls in this transaction. */
    private boolean alreadyInSave = false;
      /**
     * Stores the object in the database.  If the object is new,
     * it inserts it; otherwise an update is performed.  This method
     * is meant to be used as part of a transaction, otherwise use
     * the save() method and the connection details will be handled
     * internally
     *
     * @param con
     * @throws TorqueException
     */
    public void save(Connection con) throws TorqueException
    {
          if (!alreadyInSave)
        {
            alreadyInSave = true;


  
            // If this object has been modified, then save it to the database.
            if (isModified())
            {
                if (isNew())
                {
                    StudentPersonalInformationPeer.doInsert((StudentPersonalInformation) this, con);
                    setNew(false);
                }
                else
                {
                    StudentPersonalInformationPeer.doUpdate((StudentPersonalInformation) this, con);
                }
            }

                      alreadyInSave = false;
        }
      }


                    
      /**
     * Set the PrimaryKey using ObjectKey.
     *
     * @param  studentpersonalinformationid ObjectKey
     */
    public void setPrimaryKey(ObjectKey key)
        
    {
            setStudentpersonalinformationid(((NumberKey) key).intValue());
        }

    /**
     * Set the PrimaryKey using a String.
     *
     * @param key
     */
    public void setPrimaryKey(String key) 
    {
            setStudentpersonalinformationid(Integer.parseInt(key));
        }

  
    /**
     * returns an id that differentiates this object from others
     * of its class.
     */
    public ObjectKey getPrimaryKey()
    {
          return SimpleKey.keyFor(getStudentpersonalinformationid());
      }

 

    /**
     * Makes a copy of this object.
     * It creates a new object filling in the simple attributes.
       * It then fills all the association collections and sets the
     * related objects to isNew=true.
       */
      public StudentPersonalInformation copy() throws TorqueException
    {
        return copyInto(new StudentPersonalInformation());
    }
  
    protected StudentPersonalInformation copyInto(StudentPersonalInformation copyObj) throws TorqueException
    {
          copyObj.setStudentpersonalinformationid(studentpersonalinformationid);
          copyObj.setStudentid(studentid);
          copyObj.setSex(sex);
          copyObj.setBirthdate(birthdate);
          copyObj.setCivilstatus(civilstatus);
          copyObj.setCitizenship(citizenship);
          copyObj.setResidentialaddress(residentialaddress);
          copyObj.setResidentialaddresszipid(residentialaddresszipid);
          copyObj.setResidentialaddressprovinceid(residentialaddressprovinceid);
          copyObj.setResidentialaddressregionid(residentialaddressregionid);
          copyObj.setResidentialaddresscountryid(residentialaddresscountryid);
          copyObj.setCollegeaddress(collegeaddress);
          copyObj.setCollegeaddresszipid(collegeaddresszipid);
          copyObj.setCollegeaddressprovinceid(collegeaddressprovinceid);
          copyObj.setCollegeaddressregionid(collegeaddressregionid);
          copyObj.setCollegeaddresscountryid(collegeaddresscountryid);
          copyObj.setTelephonenumber(telephonenumber);
          copyObj.setCellularphonenumber(cellularphonenumber);
          copyObj.setEmail(email);
          copyObj.setHighschool(highschool);
          copyObj.setHighschoolgrade(highschoolgrade);
          copyObj.setFatherfirstname(fatherfirstname);
          copyObj.setFathermiddlename(fathermiddlename);
          copyObj.setFatherlastname(fatherlastname);
          copyObj.setMotherfirstname(motherfirstname);
          copyObj.setMothermiddlename(mothermiddlename);
          copyObj.setMotherlastname(motherlastname);
          copyObj.setGuardianfirstname(guardianfirstname);
          copyObj.setGuardianmiddlename(guardianmiddlename);
          copyObj.setGuardianlastname(guardianlastname);
          copyObj.setGuardianaddress(guardianaddress);
          copyObj.setGuardianaddresszipid(guardianaddresszipid);
          copyObj.setGuardianaddressprovinceid(guardianaddressprovinceid);
          copyObj.setGuardianaddressregionid(guardianaddressregionid);
          copyObj.setGuardianaddresscountryid(guardianaddresscountryid);
          copyObj.setGuardiancontactnumber(guardiancontactnumber);
          copyObj.setGuardianrelation(guardianrelation);
          copyObj.setGuardianemail(guardianemail);
  
                    copyObj.setStudentpersonalinformationid(0);
                                                                                                                                                                                                                                          
        
        return copyObj;
    }

    /**
     * returns a peer instance associated with this om.  Since Peer classes
     * are not to have any instance attributes, this method returns the
     * same instance for all member of this class. The method could therefore
     * be static, but this would prevent one from overriding the behavior.
     */
    public StudentPersonalInformationPeer getPeer()
    {
        return peer;
    }

    public String toString()
    {
        StringBuffer str = new StringBuffer();
        str.append("StudentPersonalInformation:\n");
        str.append("Studentpersonalinformationid = ")
           .append(getStudentpersonalinformationid())
           .append("\n");
        str.append("Studentid = ")
           .append(getStudentid())
           .append("\n");
        str.append("Sex = ")
           .append(getSex())
           .append("\n");
        str.append("Birthdate = ")
           .append(getBirthdate())
           .append("\n");
        str.append("Civilstatus = ")
           .append(getCivilstatus())
           .append("\n");
        str.append("Citizenship = ")
           .append(getCitizenship())
           .append("\n");
        str.append("Residentialaddress = ")
           .append(getResidentialaddress())
           .append("\n");
        str.append("Residentialaddresszipid = ")
           .append(getResidentialaddresszipid())
           .append("\n");
        str.append("Residentialaddressprovinceid = ")
           .append(getResidentialaddressprovinceid())
           .append("\n");
        str.append("Residentialaddressregionid = ")
           .append(getResidentialaddressregionid())
           .append("\n");
        str.append("Residentialaddresscountryid = ")
           .append(getResidentialaddresscountryid())
           .append("\n");
        str.append("Collegeaddress = ")
           .append(getCollegeaddress())
           .append("\n");
        str.append("Collegeaddresszipid = ")
           .append(getCollegeaddresszipid())
           .append("\n");
        str.append("Collegeaddressprovinceid = ")
           .append(getCollegeaddressprovinceid())
           .append("\n");
        str.append("Collegeaddressregionid = ")
           .append(getCollegeaddressregionid())
           .append("\n");
        str.append("Collegeaddresscountryid = ")
           .append(getCollegeaddresscountryid())
           .append("\n");
        str.append("Telephonenumber = ")
           .append(getTelephonenumber())
           .append("\n");
        str.append("Cellularphonenumber = ")
           .append(getCellularphonenumber())
           .append("\n");
        str.append("Email = ")
           .append(getEmail())
           .append("\n");
        str.append("Highschool = ")
           .append(getHighschool())
           .append("\n");
        str.append("Highschoolgrade = ")
           .append(getHighschoolgrade())
           .append("\n");
        str.append("Fatherfirstname = ")
           .append(getFatherfirstname())
           .append("\n");
        str.append("Fathermiddlename = ")
           .append(getFathermiddlename())
           .append("\n");
        str.append("Fatherlastname = ")
           .append(getFatherlastname())
           .append("\n");
        str.append("Motherfirstname = ")
           .append(getMotherfirstname())
           .append("\n");
        str.append("Mothermiddlename = ")
           .append(getMothermiddlename())
           .append("\n");
        str.append("Motherlastname = ")
           .append(getMotherlastname())
           .append("\n");
        str.append("Guardianfirstname = ")
           .append(getGuardianfirstname())
           .append("\n");
        str.append("Guardianmiddlename = ")
           .append(getGuardianmiddlename())
           .append("\n");
        str.append("Guardianlastname = ")
           .append(getGuardianlastname())
           .append("\n");
        str.append("Guardianaddress = ")
           .append(getGuardianaddress())
           .append("\n");
        str.append("Guardianaddresszipid = ")
           .append(getGuardianaddresszipid())
           .append("\n");
        str.append("Guardianaddressprovinceid = ")
           .append(getGuardianaddressprovinceid())
           .append("\n");
        str.append("Guardianaddressregionid = ")
           .append(getGuardianaddressregionid())
           .append("\n");
        str.append("Guardianaddresscountryid = ")
           .append(getGuardianaddresscountryid())
           .append("\n");
        str.append("Guardiancontactnumber = ")
           .append(getGuardiancontactnumber())
           .append("\n");
        str.append("Guardianrelation = ")
           .append(getGuardianrelation())
           .append("\n");
        str.append("Guardianemail = ")
           .append(getGuardianemail())
           .append("\n");
        return(str.toString());
    }
}
